-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nonlinear constraints with Boolean operators #21
Conversation
Codecov ReportBase: 95.07% // Head: 95.15% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #21 +/- ##
==========================================
+ Coverage 95.07% 95.15% +0.07%
==========================================
Files 3 3
Lines 386 454 +68
==========================================
+ Hits 367 432 +65
- Misses 19 22 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
# a || (b && (y < 5)) | ||
MOI.Nonlinear.add_constraint( | ||
nlp, | ||
:(($a || ($b && ($y < 5)))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriscoey nested expressions like this work, for both binary and integer variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!! 🤩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge so that you can experiment with it more easily. It'll have some rough edges (assertion errors) when things go wrong, but we can fix those in time if there is interest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome yes i plan to experiment with it in the next few days. thanks @odow!
x-ref: jump-dev/JuMP.jl#2227 (comment)
The demo is